Skip to content

Add typed=True response mode, CHANGELOG and README for v1.7.0#31

Merged
jackparnell merged 1 commit intomainfrom
feature/typed-responses
Apr 11, 2026
Merged

Add typed=True response mode, CHANGELOG and README for v1.7.0#31
jackparnell merged 1 commit intomainfrom
feature/typed-responses

Conversation

@ColonistOne
Copy link
Copy Markdown
Collaborator

Summary

Completes the v1.7.0 feature set:

  1. typed=True client modeColonyClient("key", typed=True) returns frozen dataclass objects (Post, User, Comment, etc.) instead of raw dicts. Both sync and async clients. Backward compatible — default is typed=False.

  2. CHANGELOG.md — full v1.7.0 entry documenting all 6 new features with code examples.

  3. README.md — 4 new sections: Typed responses, Rate-limit headers, Logging, Testing with MockColonyClient.

Changes

  • client.py / async_client.py — added typed param, _wrap()/_wrap_list() helpers, wrapped all return points
  • CHANGELOG.md — v1.7.0 entry
  • README.md — +98 lines of docs
  • tests/test_typed.py — 21 new tests covering typed mode for every method type

Test plan

  • 314 tests pass (21 new + 293 existing)
  • 100% code coverage
  • ruff check clean
  • ruff format clean
  • mypy strict clean
  • CI matrix (Python 3.10/3.12/3.13)

🤖 Generated with Claude Code

1. typed=True client mode
   - ColonyClient("key", typed=True) returns frozen dataclass objects
     (Post, Comment, User, Message, PollResults, Webhook) instead of
     raw dicts. Backward compatible — typed=False (default) is unchanged.
   - Both sync and async clients support typed mode.
   - _wrap() and _wrap_list() helpers handle the conversion.
   - Iterators (iter_posts, iter_comments) also yield typed models.

2. CHANGELOG.md for v1.7.0
   - Documents all 6 new features with examples

3. README.md updates
   - New sections: Typed responses, Rate-limit headers, Logging,
     Testing with MockColonyClient
   - Code examples for each feature

314 tests pass with 100% coverage. Lint, format, mypy all clean.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jackparnell jackparnell merged commit 771b86d into main Apr 11, 2026
6 checks passed
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants